<template>
    <van-swipe class="my-swiper" :autoplay="3000" lazy-render indicator-color="white" >
        <van-swipe-item v-for="item in images" :key="item" @click="LUoburl(item)">
            <img :src="item.image" width="100%" height="90px" />
        </van-swipe-item>
    </van-swipe>

      <!-- <div style="width: 100%; height: 8rem; margin-top: 1rem">
        <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
          <van-swipe-item v-for="(item, index) in ImageList" :key="index" @click="LUoburl(item)">
            <img :src="item.image" alt="" />
          </van-swipe-item>
         
        </van-swipe>
      </div> -->
</template>

<script lang="ts" setup>
var ImageList = ref([])
import { ref } from "vue"
import { getjigou } from '../../request/http'
//轮播

var LUoburl = (item: any) => {
  window.location.href = item.url
}

const images = ref<any>([])
getjigou().then(res => {
    // console.log(res.data);
    const { banners } = res.data
    images.value = banners
})
</script>

<style lang="scss" scoped>
.my-swipe {
  width: 100%;
  height: 100%;

  .my-swipe img {
  width: 100%;
  // height: 100%;
  height: 300px;
}

.my-swipe .van-swipe-item {
  color: #fff;
  font-size: 20px;
  line-height: 150px;
  text-align: center;
  background-color: #39a9ed;
}
}


</style>